wayland: avoid referencing unallocated memory when uninhibiting
authorMichael Terry <mike@mterry.name>
Sun, 6 Dec 2020 23:36:58 +0000 (18:36 -0500)
committerMichael Terry <mike@mterry.name>
Sun, 6 Dec 2020 23:37:40 +0000 (18:37 -0500)
gtk/gtkapplication-wayland.c

index 76fa144751862bf7f43a555ceb0d37c431078053..7bc311b7f1884cf20566c84102ae536dfa387cfc 100644 (file)
@@ -122,7 +122,7 @@ gtk_application_impl_wayland_inhibit (GtkApplicationImpl         *impl,
   if (!flags)
     return 0;
 
-  inhibitor = g_slice_new (GtkApplicationWaylandInhibitor);
+  inhibitor = g_slice_new0 (GtkApplicationWaylandInhibitor);
   inhibitor->cookie = ++wayland->next_cookie;
   inhibitor->flags = flags;
   wayland->inhibitors = g_slist_prepend (wayland->inhibitors, inhibitor);